package com.king.designpatterns.创造型模式.建造者模式;

/**
 * 建造计算机的Director
 *
 * @author king
 * @date 2021-06-07 17:26
 */
public class ComputerDirector {
    ComputerBuilder builder;

    /**
     * 构造T410型计算机
     * @return T410
     */
    public T410 constructT410() {
        builder = new T410Builder();
        builder.buildCpu();
        builder.buildRam();
        builder.buildHardDisk();
        builder.buildGraphicCard();
        builder.buildMonitor();
        builder.buildOs();
        return (T410) builder.getResult();
    }

    /**
     * 构造X201型计算机
     * @return X201
     */
    public X201 constructX201() {
        builder = new X201Builder();
        builder.buildCpu();
        builder.buildRam();
        builder.buildHardDisk();
        builder.buildMonitor();
        builder.buildOs();
        return (X201) builder.getResult();
    }
}
